<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$.getJSON</title>
</head>
<body>

</body>
<script src="js/jquery-3.6.0.js"></script>
<script>
    $.get('js/test.txt', function (data) {
        console.log("用 get 方法")
        console.log(data);
    });

    $.getJSON('js/test.txt', function (data) {
        console.log("用 getJSON 方法")
        console.log(data);
    })
</script>
</html>